package com.novel.utils;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class ReferTag extends SimpleTagSupport{

	@Override
	public void doTag() throws JspException, IOException {
		 PageContext pageContext =  (PageContext) this.getJspContext();  
	     HttpServletRequest request =  (HttpServletRequest) pageContext.getRequest();  
	     HttpServletResponse response =  (HttpServletResponse) pageContext.getResponse();
	     String token = (String) request.getSession().getAttribute("mytoken");
	     if(token==null){
	    	 response.sendRedirect("/Novel/index.jsp");
	     }
	}
	
}
